import { createStore } from 'vuex'
import { user, cart, category } from './modules'
import createPersistedstate from 'vuex-persistedstate'

export default createStore({
  state: {},
  getters: {},
  mutations: {},
  actions: {},
  modules: { user, cart, category },
  //配置Vuex数据持久化插件
  plugins: [
    createPersistedstate({
      key: 'erabbit-pc-store',
      paths: ['user', 'cart']
    })
  ]
})
